package com.dutiantech.zimg.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ZimgKit {
	
	private final Logger logger = LoggerFactory.getLogger(getClass());
	
	@Value("${parts.zimg.url}")
	public String zimgUrl = "http://123.56.90.180:8000";

	@Value("${parts.tmp.path}")
	public String tmpPath = "tmp/";

	public static final String usrPath = System.getProperty("user.home");

	/**
	 * 临时图片文件目录
	 * 
	 * @return
	 */
	public String getTmpPath() {
		String tmpFullPath = new StringBuilder(100).append(usrPath).append("/").append(tmpPath).toString();
		logger.info("上传zimg图片的临时文件路径: {}", tmpFullPath);
		return tmpFullPath;
	}
}
